package com.ssy.lingxi.platform.manage.entity.base;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;

/**
 * 省市区地区实体类
 * @author wrc
 * @version 2.0.0
 * @date 2020/6/19
 */
@Data
@Entity
@Table(schema = "public", name = "man_area", uniqueConstraints = {@UniqueConstraint(columnNames="code")}, indexes = {
        @Index(name = "man_area_pcode_idx", columnList = "pcode")})
public class Area {

    @ApiModelProperty(value = "主键id")
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "man_area_seq")
    private Long id;

    @ApiModelProperty(value = "地区编码")
    @Column(name = "code", nullable = false)
    private String code;

    @ApiModelProperty(value = "地区名字")
    @Column(name = "name", nullable = false)
    private String name;

    @ApiModelProperty(value = "地区等级")
    @Column(name = "level", nullable = false)
    private Integer level;

    @ApiModelProperty(value = "地区父编码")
    @Column(name  = "pcode", nullable = false)
    private String pcode;
}
